package callback_model;



public class CallBackModel1 {
	public static void main(String[] args) {
		FindPrime.getPrime(new Prime(){

			@Override
			public void printPrime(int num) {
				System.out.printf("%4d",num);
			}});
	}

}

interface Prime{
	void printPrime(int num);
}
class FindPrime{
	public static boolean fact(int num){
	    boolean judge=false;
		for(int i=2;i<=Math.sqrt(num);i++){
			if(num%i==0){
				judge=true;
			    break;
			}
		}
		return judge;
	}
	public static void getPrime(Prime pri){
		int n=0;
		for(int i=1;i<100;i++){
			if(fact(i)==false){
				pri.printPrime(i);
				n++;
				if(n%10==0)
					System.out.println();
			}
	    }
	}
}